home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / konq_settings.h < prev    next >
Encoding:
C/C++ Source or Header  |  2005-10-10  |  4.2 KB  |  142 lines

  1. /* This file is part of the KDE project
  2.    Copyright (C) 1999 David Faure <faure@kde.org>
  3.  
  4.    This library is free software; you can redistribute it and/or
  5.    modify it under the terms of the GNU Library General Public
  6.    License as published by the Free Software Foundation; either
  7.    version 2 of the License, or (at your option) any later version.
  8.  
  9.    This library is distributed in the hope that it will be useful,
  10.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  11.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  12.    Library General Public License for more details.
  13.  
  14.    You should have received a copy of the GNU Library General Public License
  15.    along with this library; see the file COPYING.LIB.  If not, write to
  16.    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  17.    Boston, MA 02110-1301, USA.
  18. */
  19.  
  20. #ifndef __konq_settings_h__
  21. #define __konq_settings_h__
  22.  
  23. class KConfig;
  24. #include <qcolor.h>
  25. #include <qstring.h>
  26. #include <qfont.h>
  27. #include <qmap.h>
  28.  
  29. #include <libkonq_export.h>
  30.  
  31. /**
  32.  * The class KonqFMSettings holds the general settings for the
  33.  * icon/tree views in konqueror/kdesktop.
  34.  * There is no 'local' (per-URL) instance of it.
  35.  * All those settings can only be changed in kcmkonq.
  36.  *
  37.  * Using this class from konqueror and from kdesktop return
  38.  * different settings, since the config file is different.
  39.  * konquerorrc, group "FMSettings", and kdesktoprc, group "FMSettings"
  40.  * The kcontrol modules handles both files, depending where
  41.  * it's called from.
  42.  */
  43.  
  44. class LIBKONQ_EXPORT KonqFMSettings
  45. {
  46. protected:
  47.   /**
  48.    * @internal
  49.    * Constructs a KonqFMSettings instance from a config file.
  50.    */
  51.   KonqFMSettings( KConfig * config );
  52.  
  53.   /** Destructor. Don't delete any instance by yourself. */
  54.   virtual ~KonqFMSettings();
  55.  
  56. public:
  57.  
  58.   /**
  59.    * The static instance of KonqFMSettings
  60.    */
  61.   static KonqFMSettings * settings();
  62.  
  63.   /**
  64.    * Reparse the configuration to update the already-created instances
  65.    *
  66.    * Warning : you need to call KGlobal::config()->reparseConfiguration()
  67.    * first (This is not done here so that the caller can avoid too much
  68.    * reparsing if having several classes from the same config file)
  69.    */
  70.   static void reparseConfiguration();
  71.  
  72.   // Use settings (and mimetype definition files)
  73.   // to find whether to embed a certain service type or not
  74.   // Only makes sense in konqueror.
  75.   bool shouldEmbed( const QString & serviceType ) const;
  76.  
  77.   // Behaviour settings
  78.   bool wordWrapText() const { return m_bWordWrapText; }
  79.   int iconTextHeight() const { return m_iconTextHeight; }
  80.   int iconTextWidth() const;
  81.   bool underlineLink() const { return m_underlineLink; }
  82.   bool fileSizeInBytes() const { return m_fileSizeInBytes; }
  83.   bool alwaysNewWin() const { return m_alwaysNewWin; }
  84.   const QString & homeURL() const { return m_homeURL; }
  85.  
  86.   bool showFileTips() const {return m_showFileTips; }
  87.   bool showPreviewsInFileTips() const;
  88.   int numFileTips() const {return m_numFileTips; }
  89.     bool renameIconDirectly() const;
  90.  
  91.   // Font settings
  92.   const QFont& standardFont() const { return m_standardFont; }
  93.  
  94.   // Color settings
  95.   const QColor& normalTextColor() const { return m_normalTextColor; }
  96.   const QColor& highlightedTextColor() const { return m_highlightedTextColor; }
  97.   const QColor& itemTextBackground() const { return m_itemTextBackground; }
  98.  
  99.   int textPreviewIconTransparency() const { return m_iconTransparency; }
  100.  
  101.   int caseSensitiveCompare( const QString& a, const QString& b ) const;
  102.  
  103. private:
  104.  
  105.   static KonqFMSettings * s_pSettings;
  106.  
  107.   bool m_underlineLink;
  108.   bool m_fileSizeInBytes;
  109.   bool m_alwaysNewWin;
  110.   bool m_bTreeFollow;
  111.  
  112.   QMap<QString, QString> m_embedMap;
  113.  
  114.   QFont m_standardFont;
  115.  
  116.   QColor m_normalTextColor;
  117.   QColor m_highlightedTextColor;
  118.   QColor m_itemTextBackground;
  119.  
  120.   bool m_bWordWrapText;
  121.   int m_iconTextHeight;
  122.  
  123.   QString m_homeURL;
  124.   bool m_showFileTips;
  125.   int  m_numFileTips;
  126.  
  127.   // used for the textpreview
  128.   int m_iconTransparency;
  129.  
  130.   /** Called by constructor and reparseConfiguration */
  131.   void init( KConfig * config );
  132.  
  133.   struct KonqFMSettingsPrivate * d;
  134.  
  135.   // There is no default constructor. Use the provided ones.
  136.   KonqFMSettings();
  137.   // No copy constructor either. What for ?
  138.   KonqFMSettings( const KonqFMSettings &);
  139. };
  140.  
  141. #endif
  142.